using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace XiaoMan.Model.Models.Mapping
{
    public class Forum_TopicMap : EntityTypeConfiguration<Forum_Topic>
    {
        public Forum_TopicMap()
        {
            // Primary Key
            this.HasKey(t => t.TopicID);

            // Properties
            this.Property(t => t.TopicTitle)
                .HasMaxLength(50);

            this.Property(t => t.TopicContent)
                .HasMaxLength(150);

            this.Property(t => t.UserNikeName)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("Forum_Topic");
            this.Property(t => t.TopicID).HasColumnName("TopicID");
            this.Property(t => t.TopicTitle).HasColumnName("TopicTitle");
            this.Property(t => t.TopicContent).HasColumnName("TopicContent");
            this.Property(t => t.TopicPicCount).HasColumnName("TopicPicCount");
            this.Property(t => t.UserID).HasColumnName("UserID");
            this.Property(t => t.UserNikeName).HasColumnName("UserNikeName");
            this.Property(t => t.TopicTypeID).HasColumnName("TopicTypeID");
            this.Property(t => t.DiseaseID).HasColumnName("DiseaseID");
            this.Property(t => t.UpVoteCount).HasColumnName("UpVoteCount");
            this.Property(t => t.CommentCount).HasColumnName("CommentCount");
            this.Property(t => t.CollectCount).HasColumnName("CollectCount");
            this.Property(t => t.IsEssential).HasColumnName("IsEssential");
            this.Property(t => t.IsTop).HasColumnName("IsTop");
            this.Property(t => t.IsTopForSingleUser).HasColumnName("IsTopForSingleUser");
            this.Property(t => t.IsDelFlag).HasColumnName("IsDelFlag");
            this.Property(t => t.IsAudit).HasColumnName("IsAudit");
            this.Property(t => t.VirtualMoney).HasColumnName("VirtualMoney");
            this.Property(t => t.VirtualMoneyPayBackID).HasColumnName("VirtualMoneyPayBackID");
            this.Property(t => t.CreateTime).HasColumnName("CreateTime");

            //// Relationships
            //this.HasOptional(t => t.Sys_Users)
            //    .WithMany(t => t.Forum_Topic)
            //    .HasForeignKey(d => d.UserID);

        }
    }
}
